using System;
using System.Collections.Generic;
using System.Text;

namespace GeneticAlgorithm.CP3.ParseTree
{
    class Individual : Individual<LispLib.Interpreter.Pair, LispLib.Interpreter.Pair>
    {
        private static int pos = 0;

        public Individual(string expression, params Individual<LispLib.Interpreter.Pair, LispLib.Interpreter.Pair>[] parents)
            : base(LispLib.Interpreter.ReadOneExpr(expression, ref pos, expression.Length) as LispLib.Interpreter.Pair,
            parents)
        {
            pos = 0;
        }

        public Individual(LispLib.Interpreter.Pair genotype, params Individual<LispLib.Interpreter.Pair, LispLib.Interpreter.Pair>[] parents)
            : base(genotype, parents)
        { }

        public override LispLib.Interpreter.Pair GeneticMapping(LispLib.Interpreter.Pair genotype)
        {
            // genotype and phenotype are the same: parsed tree of Lisp expression
            return genotype;
        }
    }
}
